<extend name="Public:base" />

<block name="content">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><em class="glyphicon glyphicon-cloud-upload"></em> 
            {$type}         
            </h3>
        </div>
        
    </div>

    <div class="row margin-botton">
        <div class="col-sm-6 column">
            <div class="btn-group btn-group-md">
                <button class="btn btn-primary" type="button" onclick="goUrl('{:U('add')}')"><em class="glyphicon glyphicon-plus-sign"></em> 添加菜单</button>
                <button class="btn btn-default" type="button" onclick="doGoSubmit('{:U('sort')}','form_do')"><em class="glyphicon glyphicon-th-list"></em> 更新排序</button>
                <button class="btn btn-default" type="button" onclick="doGoSubmit('{:U('qk')}','form_do')"><em class="glyphicon glyphicon-th-list"></em> 更新快捷面板</button>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <form action="" method="post" id="form_do" name="form_do">
                <div class="table-responsive">
                    <table class="table table-hover xyh-table-bordered-out">
                        <thead>
                            <tr class="active">
                                <th>编号</th>
                                <th>名称</th>
                                <th>URL</th>
                                <th>显示</th>
                                <th>排序</th>
                                <th>快捷</th>
                                <th class="text-right">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <foreach name='cate' item='v'>
                        <tr>
                            <td>{$v.id}</td>
                            <td class="aleft">{$v.delimiter}<if condition="$v['pid'] neq 0">├─</if>{$v.name}</td>
                            <td>{$v.url}</td>
                            <td><if condition="$v['status']"><span class="label label-success">是</span><else/><span class="label label-default">否</span></if></td>        
                            <td><input type="text" name="sortlist[{$v.id}]" value="{$v.sort}" id="sortlist" size="5" class="xyh-form-control" /></td>
                            <td><input type="checkbox" name="quicklist[]" value="{$v.id}" <notempty name="v['quick']"> checked="checked"</notempty> <if condition="$v['level'] neq 3">disabled="disabled"</if> /></td>
                            <td class="text-right">
                                <if condition="in_array($v['id'],array(6,7))">
                                    <a class="label label-default">添加子菜单</a>
                                    <a class="label label-default">修改</a>
                                    <a class="label label-default">删除</a>
                                <elseif condition="$v['id'] eq 1" />
                                    <a href="{:U('add',array('pid' => $v['id']))}" class="label label-info">添加子菜单</a>
                                    <a class="label label-default">修改</a>
                                    <a class="label label-default">删除</a>
                                <else/>
                                    <a href="{:U('add',array('pid' => $v['id']))}" class="label label-info">添加子菜单</a>
                                    <a href="{:U('edit',array('id' => $v['id']))}" class="label label-success">修改</a>
                                    <a href="javascript:;" onclick="toConfirm('{:U('del', array('id' => $v['id']))}', '确实要删除吗？')" class="label label-danger">删除</a>
                                </if> 
                            </td>
                        </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
            </form>
            
        </div>
    </div>

    </block>